<!DOCTYPE html>
<html>
<head>
    <title>车位查看</title>
<#include "../common/common.ftl"/>
</head>
<body>
<div class="layui-fluid">
    <blockquote class="layui-elem-quote layui-bg-white" style="height: 110px">
        <div class="layui-col-xs2">项目：<span class="jmdf-color-red">${(azProject.projectName)!} </span>--> 车位统计</div>
        <div class="layui-col-xs10">
        <#assign carLotMapCountMap= (carLotMap[azProject.id?c])!/>
        <#if carLotMapCountMap?size ==0>
        <#else>
            <table class="layui-table" lay-size="sm" style="text-align: center;width: 80%;margin-top: -10px">
                <tr class="layui-bg-gray">
                    <td style="width: 15%"></td>
                    <td>总数量</td>
                    <td>总面积【㎡】</td>
                    <td>已选数量</td>
                    <td>已选面积【㎡】</td>
                    <td>未选数量</td>
                    <td>未选面积【㎡】</td>
                </tr>
                <tr>
                    <td>普通车位</td>
                    <td>${carLotMapCountMap['normalType']}</td>
                    <td>${carLotMapCountMap['normalTypeArea']}</td>
                    <td>${carLotMapCountMap['normalTypeChoose']}</td>
                    <td>${carLotMapCountMap['normalTypeChooseArea']}</td>
                    <td>${carLotMapCountMap['normalTypeUnChoose']}</td>
                    <td>${carLotMapCountMap['normalTypeUnChooseArea']}</td>
                </tr>
                <tr>
                    <td>人防车位</td>
                    <td>${carLotMapCountMap['rfType']}</td>
                    <td>${carLotMapCountMap['rfTypeArea']}</td>
                    <td>${carLotMapCountMap['rfTypeChoose']}</td>
                    <td>${carLotMapCountMap['rfTypeChooseArea']}</td>
                    <td>${carLotMapCountMap['rfTypeUnChoose']}</td>
                    <td>${carLotMapCountMap['rfTypeUnChooseArea']}</td>
                </tr>
                <tr>
                    <td>合计</td>
                    <td>${carLotMapCountMap['allCount']}</td>
                    <td>${carLotMapCountMap['allCountArea']}</td>
                    <td>${carLotMapCountMap['choose']}</td>
                    <td>${carLotMapCountMap['chooseArea']}</td>
                    <td>${carLotMapCountMap['unChoose']}</td>
                    <td>${carLotMapCountMap['unChooseArea']}</td>
                </tr>
            </table>
        </#if>
        </div>
    </blockquote>

    <div class="layui-card">
        <div class="layui-card-body">
            <form class="layui-form" id="searchForm">
                幢号：
                <div class="layui-inline" style="width: 120px;">
                    <input class="layui-input" name="search_eq_string_c.buildNum" autocomplete="off">
                </div>
                户号：
                <div class="layui-inline" style="width: 120px;">
                    <input class="layui-input" name="search_like_string_c.houseNum" autocomplete="off">
                </div>
                所在楼层：
                <div class="layui-inline" style="width: 150px;">
                    <input class="layui-input" name="search_eq_integer_c.floor" autocomplete="off">
                </div>
                车位类型：
                <div class="layui-inline" style="width: 120px;">
                    <select name="search_eq_integer_c.carLotType" id="carLotTypeSelect">
                        <option value="">--请选择--</option>
                    </select>
                </div>
                房源状态：
                <div class="layui-inline" style="width: 120px;">
                    <select name="search_eq_integer_c.houseStatus" id="houseStatusSelect">
                        <option value="">--请选择--</option>
                    </select>
                </div>
                <button class="layui-btn" type="button" id="searchButton"><i
                        class="layui-icon layui-icon-search"></i> 搜索
                </button>
            </form>
            <table id="dataTable" class="layui-table" lay-filter="layFilter"></table>
            <!--序号-->
            <script type="text/html" id="indexTpl">
                {{d.LAY_TABLE_INDEX+1}}
            </script>
            <!--菜单-->
            <script type="text/html" id="dataTable_toolbar">
                <a class="layui-btn layui-btn-xs jmdf-btn-view" lay-event="dataTable_view"><i
                        class="layui-icon layui-icon-friends"></i>查看</a>
            </script>
        </div>
    </div>
</div>
<script src="/layui/layui.js" charset="utf-8"></script>
<script>
    layui.config({
        base: '/modules/' //静态资源所在路径
    }).use(['table', 'form', 'jquery', 'jmdf', 'page', 'dataDict'], function () {
        var $ = layui.jquery, jmdf = layui.jmdf, page = layui.page, table = layui.table, form = layui.form, dataDict = layui.dataDict;
        /***********************table表格相关操作 start*************************/
        var tableRenderId = "renderId";
        var tableId = "dataTable";
        var table_layFilter = "layFilter";
        var tableUrl = "loadCarLotList?azProjectId=${(azProject.id)!}";

        //列项内容
        var cols = [[
            {title: "序号", toolbar: '#indexTpl', fixed: 'left', align: 'center', width: 60}
            , {field: "buildNum", title: "幢号", align: 'center', minWidth: 120}
            , {field: "houseNum", title: "户号", align: 'center', minWidth: 120}
            , {field: "floor", title: "所在层数", align: 'center', minWidth: 100}
            , {field: "buildArea", title: "建筑面积（㎡）", align: 'center', minWidth: 150}
            , {field: "carLotType", title: "车位类型", align: 'center', minWidth: 120}
            , {
                field: "houseStatus", title: "车位状态", align: 'center', minWidth: 100, templet: function (d) {
                    return d.houseStatusStr;
                }
            }
            , {field: "chooseHouseDate", title: "选房时间", align: 'center', minWidth: 240}
            , {title: '操作', fixed: 'right', align: 'center', toolbar: '#dataTable_toolbar', minWidth: 240}
        ]];
        //table设置项
        var options = {
            elem: '#' + tableId//table列表id值
            , url: tableUrl
            , cols: cols
            , id: tableRenderId
            , defaultToolbar: ['filter', 'print']//显示列、打印
            , autoSort: false //禁用前端自动排序。
            , height: "full-160"
        };

        //初始表格（含分页设置）
        page.render(options);
        //表格排序
        page.sort(tableId, tableRenderId);
        //刷新当前页方法封装
        page.reload();

        //分页查询（查询条件）
        $("#searchButton").click(function () {
            page.search("searchForm", tableRenderId);
        });
        dataDict.select("房源状态", "houseStatusSelect", "");
        dataDict.select("车位类型", "carLotTypeSelect", "");


        table.on("tool(" + table_layFilter + ")", function (obj) {
            var data = obj.data;///获得当前行数据
            var layEvent = obj.event;//获得lay-event对应的值
            var id = data["id"];
            if (layEvent == "dataTable_view") {
                jmdf.view("carLotView?azProjectId=" + ${(azProject.id)!} +"&carLotId=" + id)
            }
        });
    });
</script>
</body>
</html>